package com.sg.service.biz.pbff.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.sg.common.util.CommonFunctionHelper;
import com.sg.common.util.RedisUtil;
import com.sg.dto.biz.pbff.req.*;
import com.sg.dto.biz.pbff.res.*;
import com.sg.service.biz.pbff.SchemeOpenRecordService;
import com.wicket.okrapp.integration.EvaThemeService;
import com.wicket.okrcomponent.integration.ConfSchemeService;
import com.wicket.okrcomponent.integration.DivineDataService;
import com.wicket.okrcomponent.integration.SchemeOpenRecordService;
import com.wicket.okrcomponent.integration.dto.*;
import com.wicket.okrframework.integration.BaseService;
import com.wicket.okrframework.integration.InductionRecordService;
import com.wicket.okrframework.integration.OrgService;
import com.wicket.okrframework.integration.FwBaseSecurityClient;
import com.wicket.okrframework.integration.dto.*;
import com.sg.common.exception.Assert;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.stream.Collectors;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Service
public class SchemeOpenRecordServiceImpl implements SchemeOpenRecordService {

    @Resource
    com.sg.service.biz.component.SchemeOpenRecordService fwCompSchemeOpenRecordClient;
    @Resource
    com.sg.service.biz.framework.InductionRecordService fwBaseInductionRecordClient;
    @Resource
    private RedisUtil redisUtil;
    @Resource
    com.sg.service.biz.component.ConfSchemeService fwCompConfSchemeClient;
    @Resource
    com.sg.service.biz.component.DivineDataService fwCompDivineDataClient;

    @Resource
    com.sg.service.biz.framework.BaseService fwBaseBaseClient;

    @Resource
    com.sg.service.biz.framework.OrgService fwBaseOrgClient;

    @Resource
    com.sg.service.biz.app.EvaThemeService fwAppEvaThemeClient;
    @Resource
    com.sg.service.biz.framework.SecurityService fwBaseSecurityClient;

    /**
     * B2-3查询方案开通记录列表（平台）[2099]
     * gen by moon at 9/14/2022, 5:56:56 PM
     */
    @Trace(operationName = "B2-3查询方案开通记录列表（平台）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffQuerySchemeOpenRecordListRespDto querySchemeOpenRecordList(BffQuerySchemeOpenRecordListReqDto reqDto) {


        QuerySchemeOpenRecordListRespDto querySchemeOpenRecordListRespDto_1 = null;
        BatchQueryInductionRecordListComRespDto batchQueryInductionRecordListComRespDto_1 = null;
//步骤0: D2-3查询方案开通记录列表 - querySchemeOpenRecordList
        QuerySchemeOpenRecordListRespDto querySchemeOpenRecordListRespDto = null;
        QuerySchemeOpenRecordListReqDto querySchemeOpenRecordListReqDto = new QuerySchemeOpenRecordListReqDto();
        if (reqDto != null) {
            querySchemeOpenRecordListReqDto.setTenantSpaceId(reqDto.getTenantSpaceId());//sourceId:61016_1
            querySchemeOpenRecordListReqDto.setConfSchemeTypeCode(reqDto.getConfSchemeTypeCode());//sourceId:61017_1
            querySchemeOpenRecordListReqDto.setIsInitialScheme(reqDto.getIsInitialScheme());//sourceId:61018_1
            querySchemeOpenRecordListReqDto.setIsArchive(reqDto.getIsArchive());//sourceId:61019_1
        }

        /*D2-3查询方案开通记录列表[2104]   */
        Assert.isNull(querySchemeOpenRecordListReqDto.getTenantSpaceId(), "B2-3查询方案开通记录列表（平台）-D2-3查询方案开通记录列表-租户空间ID不能为空", false);
        Assert.isNull(querySchemeOpenRecordListReqDto.getConfSchemeTypeCode(), "B2-3查询方案开通记录列表（平台）-D2-3查询方案开通记录列表-方案类型编码不能为空", false);
        Assert.isNull(querySchemeOpenRecordListReqDto.getIsArchive(), "B2-3查询方案开通记录列表（平台）-D2-3查询方案开通记录列表-是否存档不能为空", false);
        querySchemeOpenRecordListRespDto = fwCompSchemeOpenRecordClient.querySchemeOpenRecordList(querySchemeOpenRecordListReqDto).getData();


        querySchemeOpenRecordListRespDto_1 = querySchemeOpenRecordListRespDto;

//步骤1: D1-3批量查询就职记录列表（公共） - batchQueryInductionRecordListCom
        BatchQueryInductionRecordListComRespDto batchQueryInductionRecordListComRespDto = null;
        if (querySchemeOpenRecordListRespDto != null) {
            BatchQueryInductionRecordListComReqDto batchQueryInductionRecordListComReqDto = new BatchQueryInductionRecordListComReqDto();
            if (querySchemeOpenRecordListRespDto != null) {
                batchQueryInductionRecordListComReqDto.setPerOrgInductionRecordList(querySchemeOpenRecordListRespDto.getSchemeOpenRecordList().stream().map(item -> item.getOperationInductionId())
                        .collect(Collectors.toList()));//sourceId:61021_1
            }

            /*D1-3批量查询就职记录列表（公共）[602]   */

            batchQueryInductionRecordListComRespDto = fwBaseInductionRecordClient.batchQueryInductionRecordListCom(batchQueryInductionRecordListComReqDto).getData();


            batchQueryInductionRecordListComRespDto_1 = batchQueryInductionRecordListComRespDto;
        }

        BffQuerySchemeOpenRecordListRespDto retData = new BffQuerySchemeOpenRecordListRespDto();
        //数据集融合
        if (querySchemeOpenRecordListRespDto_1 != null && !CollectionUtil.isEmpty(querySchemeOpenRecordListRespDto_1.getSchemeOpenRecordList())) {
            for (SchemeOpenRecordDto schemeOpenRecordDto : querySchemeOpenRecordListRespDto_1.getSchemeOpenRecordList()) {
                BffSchemeOpenRecordDto retElm = new BffSchemeOpenRecordDto();
                if (querySchemeOpenRecordListRespDto_1 != null) {
                    retElm.setSchOpenRecordId(schemeOpenRecordDto.getSchOpenRecordId());//sourceId:33759_2
                    retElm.setConfSchemeId(schemeOpenRecordDto.getConfSchemeId());//sourceId:33760_2
                    retElm.setConfSchemeCode(schemeOpenRecordDto.getConfSchemeCode());//sourceId:57560_2
                    retElm.setConfSchemeName(schemeOpenRecordDto.getConfSchemeName());//sourceId:33763_2
                    retElm.setIsInitialScheme(schemeOpenRecordDto.getIsInitialScheme());//sourceId:46884_2
                    retElm.setSubjectLifeCycle(schemeOpenRecordDto.getSubjectLifeCycle());//sourceId:33766_2
                    retElm.setIsArchive(schemeOpenRecordDto.getIsArchive());//sourceId:58870_2
                    retElm.setOperationInductionId(schemeOpenRecordDto.getOperationInductionId());//sourceId:33768_2
                    retElm.setOperateTime(schemeOpenRecordDto.getOperateTime());//sourceId:33769_2
                }
                retData.getSchemeOpenRecordList().add(retElm);
                if (batchQueryInductionRecordListComRespDto_1 != null) {
                    for (PerOrgInductionRecordDto perOrgInductionRecordDto : batchQueryInductionRecordListComRespDto_1.getPerOrgInductionRecordList()) {
                        if (perOrgInductionRecordDto.getInductionRecordId().equals(schemeOpenRecordDto.getOperationInductionId())) {
                            if (batchQueryInductionRecordListComRespDto_1 != null) {
                                retElm.setUserId(perOrgInductionRecordDto.getUserId());//sourceId:39006_2
                                retElm.setUserFace(perOrgInductionRecordDto.getUserFace());//sourceId:39009_2
                                retElm.setIdCardName(perOrgInductionRecordDto.getIdCardName());//sourceId:39007_2
                                retElm.setNickName(perOrgInductionRecordDto.getNickName());//sourceId:39008_2
                            }
                        }
                    }
                }

            }
        }//sourceId:61027_1


        retData.setPageNum(querySchemeOpenRecordListRespDto.getPageNum());
        retData.setPageSize(querySchemeOpenRecordListRespDto.getPageSize());
        retData.setTotal(querySchemeOpenRecordListRespDto.getTotalNum());
        retData.setIsLastPage((Math.ceil(Double.valueOf(querySchemeOpenRecordListRespDto.getTotalNum()) / Double.valueOf(querySchemeOpenRecordListRespDto.getPageSize()))) <= retData.getPageNum());


        return retData;
    }

    /**
     * B2-3新增固定时间方案开通记录（平台）[2569]
     */
    @Trace(operationName = "B2-3新增固定时间方案开通记录（平台）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffAddFixedTimeSchemeOpenRecordRespDto addFixedTimeSchemeOpenRecord(BffAddFixedTimeSchemeOpenRecordReqDto reqDto) {


        AddSchemeOpenRecordRespDto addSchemeOpenRecordRespDto_1 = null;
//步骤0: D2-3新增方案开通记录 - addSchemeOpenRecord
        AddSchemeOpenRecordRespDto addSchemeOpenRecordRespDto = null;
        AddSchemeOpenRecordReqDto addSchemeOpenRecordReqDto = new AddSchemeOpenRecordReqDto();
        addSchemeOpenRecordReqDto.setStartTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME//sourceId:79538_1
        if (reqDto != null) {
            addSchemeOpenRecordReqDto.setConfSchemeId(reqDto.getConfSchemeId());//sourceId:79532_1
            addSchemeOpenRecordReqDto.setIsMainConfScheme(reqDto.getIsMainConfScheme());//sourceId:80731_1
            addSchemeOpenRecordReqDto.setEndTime(reqDto.getEndTime());//sourceId:79537_1
            addSchemeOpenRecordReqDto.setTenantSpaceId(reqDto.getTenantSpaceId());//sourceId:79534_1
            addSchemeOpenRecordReqDto.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//sourceId:79535_1
        }

        /*D2-3新增方案开通记录[2116]   */
        addSchemeOpenRecordRespDto = fwCompSchemeOpenRecordClient.addSchemeOpenRecord(addSchemeOpenRecordReqDto).getData();

        addSchemeOpenRecordRespDto_1 = addSchemeOpenRecordRespDto;

        BffAddFixedTimeSchemeOpenRecordRespDto retData = new BffAddFixedTimeSchemeOpenRecordRespDto();
        if (addSchemeOpenRecordRespDto_1 != null) {
            retData.setSchOpenRecordId(addSchemeOpenRecordRespDto_1.getSchOpenRecordId());//sourceId:79544_1
        }


        return retData;
    }

    /**
     * B2-3升级开通方案（平台）[2113]
     * gen by moon at 5/27/2023, 1:30:47 PM
     */
    @Trace(operationName = "B2-3升级开通方案（平台）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffArchiveSchemeOpenRecordRespDto archiveSchemeOpenRecord(BffArchiveSchemeOpenRecordReqDto reqDto) {


        //步骤0: D2-3升级开通方案 - archiveSchemeOpenRecord
        ArchiveSchemeOpenRecordRespDto archiveSchemeOpenRecordRespDto = null;
        ArchiveSchemeOpenRecordReqDto archiveSchemeOpenRecordReqDto = new ArchiveSchemeOpenRecordReqDto();
        if (reqDto != null) {
            archiveSchemeOpenRecordReqDto.setSchOpenRecordId(reqDto.getSchOpenRecordId());//SimpleFieldAssign//sourceId:61961_1
            archiveSchemeOpenRecordReqDto.setAscriptionSpaceId(reqDto.getAscriptionSpaceId());//SimpleFieldAssign//sourceId:61960_1
        }

        /*D2-3升级开通方案[2123]   */
        Assert.isNull(archiveSchemeOpenRecordReqDto.getSchOpenRecordId(), "B2-3升级开通方案（平台）-D2-3升级开通方案-开通钥匙ID不能为空", false);
        Assert.isNull(archiveSchemeOpenRecordReqDto.getAscriptionSpaceId(), "B2-3升级开通方案（平台）-D2-3升级开通方案-归属空间ID不能为空", false);
        archiveSchemeOpenRecordRespDto = fwCompSchemeOpenRecordClient.archiveSchemeOpenRecord(archiveSchemeOpenRecordReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffArchiveSchemeOpenRecordRespDto retData = new BffArchiveSchemeOpenRecordRespDto();


        return retData;
    }

    /**
     * B2-3发布方案开通记录(平台)[4118]
     * gen by moon at 5/16/2023, 12:21:55 AM
     */
    @Trace(operationName = "B2-3发布方案开通记录(平台)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffReleaseSchemeOpenRecordRespDto releaseSchemeOpenRecord(BffReleaseSchemeOpenRecordReqDto reqDto) {


        //步骤0: D2修改开通记录(公共) - updateSchOpenRecordCom
        UpdateSchOpenRecordComRespDto updateSchOpenRecordComRespDto = null;
        UpdateSchOpenRecordComReqDto updateSchOpenRecordComReqDto = new UpdateSchOpenRecordComReqDto();
        updateSchOpenRecordComReqDto.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:896439_1
        if (reqDto != null) {
            updateSchOpenRecordComReqDto.setSchOpenRecordId(reqDto.getSchOpenRecordId());//SimpleFieldAssign//sourceId:896430_1
            updateSchOpenRecordComReqDto.setApplexRelId(reqDto.getApplexRelId());//SimpleFieldAssign//sourceId:896431_1
            updateSchOpenRecordComReqDto.setApplexId(reqDto.getApplexId());//SimpleFieldAssign//sourceId:896432_1
        }

        /*D2修改开通记录(公共)[6484]   */
        Assert.isNull(updateSchOpenRecordComReqDto.getSchOpenRecordId(), "B2-3发布方案开通记录(平台)-D2修改开通记录(公共)-开通钥匙ID不能为空", false);
        Assert.isNull(updateSchOpenRecordComReqDto.getApplexRelId(), "B2-3发布方案开通记录(平台)-D2修改开通记录(公共)-使用关系ID不能为空", false);
        Assert.isNull(updateSchOpenRecordComReqDto.getApplexId(), "B2-3发布方案开通记录(平台)-D2修改开通记录(公共)-开通对象ID不能为空", false);
        Assert.isNull(updateSchOpenRecordComReqDto.getSubjectLifeCycle(), "B2-3发布方案开通记录(平台)-D2修改开通记录(公共)-主体生命周期不能为空", false);
        updateSchOpenRecordComRespDto = fwCompSchemeOpenRecordClient.updateSchOpenRecordCom(updateSchOpenRecordComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffReleaseSchemeOpenRecordRespDto retData = new BffReleaseSchemeOpenRecordRespDto();


        return retData;
    }

    /**
     * B2-3新增方案开通记录(管理)[2110]
     * gen by moon at 5/17/2023, 2:18:47 PM
     */
    @Trace(operationName = "B2-3新增方案开通记录(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffAddSchemeOpenRecordRespDto addSchemeOpenRecord(BffAddSchemeOpenRecordReqDto reqDto) {


        AddOpenRecordAuthorizationComRespDto addOpenRecordAuthorizationComRespDto_1 = null;
//步骤0: D1-2查空间详情(公共) - querySpaceDetailCom
        QuerySpaceDetailComRespDto querySpaceDetailComRespDto = null;
        QuerySpaceDetailComReqDto querySpaceDetailComReqDto = new QuerySpaceDetailComReqDto();
        if (reqDto != null) {
            querySpaceDetailComReqDto.setSpaceId(reqDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:952552_1
        }

        /*D1-2查当前空间名称[402]   */
        Assert.isNull(querySpaceDetailComReqDto.getSpaceId(), "B2-3新增方案开通记录(管理)-D1-2查当前空间名称-空间ID不能为空", false);
        querySpaceDetailComRespDto = fwBaseBaseClient.querySpaceDetailCom(querySpaceDetailComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


//步骤1: D2新增开通记录并授权(公共) - addOpenRecordAuthorizationCom
        AddOpenRecordAuthorizationComRespDto addOpenRecordAuthorizationComRespDto = null;
        if (querySpaceDetailComRespDto != null) {
            AddOpenRecordAuthorizationComReqDto addOpenRecordAuthorizationComReqDto = new AddOpenRecordAuthorizationComReqDto();
            addOpenRecordAuthorizationComReqDto.setApplexType("TENANT_SPACE");//sourceId:896059_1
            addOpenRecordAuthorizationComReqDto.setAuthorizationKeyTypeCode("TENANT_SPACE");//CUSTOM_CONVENTION//sourceId:932185_1
            if (reqDto != null) {
                addOpenRecordAuthorizationComReqDto.setConfSchemeId(reqDto.getConfSchemeId());//SimpleFieldAssign//sourceId:896049_1
                addOpenRecordAuthorizationComReqDto.setConfSchemeCode(reqDto.getConfSchemeCode());//SimpleFieldAssign//sourceId:896050_1
                addOpenRecordAuthorizationComReqDto.setAuthType(reqDto.getAuthType());//SimpleFieldAssign//sourceId:896051_1
                addOpenRecordAuthorizationComReqDto.setAuthorizationNum(reqDto.getAuthorizationNum());//SimpleFieldAssign//sourceId:896052_1
                addOpenRecordAuthorizationComReqDto.setAuthUnit(reqDto.getAuthUnit());//SimpleFieldAssign//sourceId:896053_1
                addOpenRecordAuthorizationComReqDto.setStartTime(reqDto.getStartTime());//SimpleFieldAssign//sourceId:896054_1
                addOpenRecordAuthorizationComReqDto.setEndTime(reqDto.getEndTime());//SimpleFieldAssign//sourceId:896055_1
                addOpenRecordAuthorizationComReqDto.setIsMainConfScheme(reqDto.getIsMainConfScheme());//SimpleFieldAssign//sourceId:896056_1
                addOpenRecordAuthorizationComReqDto.setApplexId(reqDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:896060_1
                addOpenRecordAuthorizationComReqDto.setTenantSpaceId(reqDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:896057_1
                addOpenRecordAuthorizationComReqDto.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:896058_1
            }
            if (querySpaceDetailComRespDto != null) {
                addOpenRecordAuthorizationComReqDto.setApplexName(querySpaceDetailComRespDto.getSpaceName());//SimpleFieldAssign//sourceId:915060_1
            }

            /*D2新增开通记录并授权(公共)[3102]   */
            Assert.isNull(addOpenRecordAuthorizationComReqDto.getConfSchemeId(), "B2-3新增方案开通记录(管理)-D2新增开通记录并授权(公共)-配置方案ID 不能为空", false);
            Assert.isNull(addOpenRecordAuthorizationComReqDto.getConfSchemeCode(), "B2-3新增方案开通记录(管理)-D2新增开通记录并授权(公共)-配置方案标识不能为空", false);
            Assert.isNull(addOpenRecordAuthorizationComReqDto.getIsMainConfScheme(), "B2-3新增方案开通记录(管理)-D2新增开通记录并授权(公共)-是否主配置方案不能为空", false);
            Assert.isNull(addOpenRecordAuthorizationComReqDto.getApplexType(), "B2-3新增方案开通记录(管理)-D2新增开通记录并授权(公共)-开通对象类型编码不能为空", false);
            Assert.isNull(addOpenRecordAuthorizationComReqDto.getApplexId(), "B2-3新增方案开通记录(管理)-D2新增开通记录并授权(公共)-开通对象ID不能为空", false);
            Assert.isNull(addOpenRecordAuthorizationComReqDto.getAuthorizationKeyTypeCode(), "B2-3新增方案开通记录(管理)-D2新增开通记录并授权(公共)-开通钥匙类型标识不能为空", false);
            Assert.isNull(addOpenRecordAuthorizationComReqDto.getApplexName(), "B2-3新增方案开通记录(管理)-D2新增开通记录并授权(公共)-冗余开通对象名称不能为空", false);
            Assert.isNull(addOpenRecordAuthorizationComReqDto.getTenantSpaceId(), "B2-3新增方案开通记录(管理)-D2新增开通记录并授权(公共)-租户空间ID不能为空", false);
            Assert.isNull(addOpenRecordAuthorizationComReqDto.getSubjectLifeCycle(), "B2-3新增方案开通记录(管理)-D2新增开通记录并授权(公共)-主体生命周期不能为空", false);
            addOpenRecordAuthorizationComRespDto = fwCompSchemeOpenRecordClient.addOpenRecordAuthorizationCom(addOpenRecordAuthorizationComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


            addOpenRecordAuthorizationComRespDto_1 = addOpenRecordAuthorizationComRespDto;
        }

        BffAddSchemeOpenRecordRespDto retData = new BffAddSchemeOpenRecordRespDto();
        if (addOpenRecordAuthorizationComRespDto_1 != null) {
            retData.setSchOpenRecordId(addOpenRecordAuthorizationComRespDto_1.getSchOpenRecordId());//SimpleFieldAssign//sourceId:896062_1
            retData.setApplexRelId(addOpenRecordAuthorizationComRespDto_1.getApplexRelId());//SimpleFieldAssign//sourceId:896063_1
        }


        return retData;
    }

    /**
     * B2-3查询方案开通记录详情(管理)[2100]
     * gen by moon at 5/13/2023, 5:24:24 AM
     */
    @Trace(operationName = "B2-3查询方案开通记录详情(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffQuerySchemeOpenRecordDetailRespDto querySchemeOpenRecordDetail(BffQuerySchemeOpenRecordDetailReqDto reqDto) {


        QuerySchemeOpenRecordDetailComRespDto querySchemeOpenRecordDetailComRespDto_1 = null;
        QueryInductionRecordInfoDetailComRespDto queryInductionRecordInfoDetailComRespDto_1 = null;
//步骤0: D2-3查询方案开通记录详情(公共) - querySchemeOpenRecordDetailCom
        QuerySchemeOpenRecordDetailComRespDto querySchemeOpenRecordDetailComRespDto = null;
        QuerySchemeOpenRecordDetailComReqDto querySchemeOpenRecordDetailComReqDto = new QuerySchemeOpenRecordDetailComReqDto();
        if (reqDto != null) {
            querySchemeOpenRecordDetailComReqDto.setSchOpenRecordId(reqDto.getSchOpenRecordId());//SimpleFieldAssign//sourceId:61123_1
            querySchemeOpenRecordDetailComReqDto.setTenantSpaceId(reqDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:901154_1
        }

        /*D2-3查询方案开通记录详情(公共)[2106]   */
        Assert.isNull(querySchemeOpenRecordDetailComReqDto.getSchOpenRecordId(), "B2-3查询方案开通记录详情(管理)-D2-3查询方案开通记录详情(公共)-开通钥匙ID不能为空", false);
        Assert.isNull(querySchemeOpenRecordDetailComReqDto.getTenantSpaceId(), "B2-3查询方案开通记录详情(管理)-D2-3查询方案开通记录详情(公共)-租户空间ID不能为空", false);
        querySchemeOpenRecordDetailComRespDto = fwCompSchemeOpenRecordClient.querySchemeOpenRecordDetailCom(querySchemeOpenRecordDetailComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        querySchemeOpenRecordDetailComRespDto_1 = querySchemeOpenRecordDetailComRespDto;

//步骤1: D1-3查询个人就职记录信息详情（公共） - queryInductionRecordInfoDetailCom
        QueryInductionRecordInfoDetailComRespDto queryInductionRecordInfoDetailComRespDto = null;
        if (querySchemeOpenRecordDetailComRespDto != null) {
            QueryInductionRecordInfoDetailComReqDto queryInductionRecordInfoDetailComReqDto = new QueryInductionRecordInfoDetailComReqDto();
            if (querySchemeOpenRecordDetailComRespDto != null) {
                queryInductionRecordInfoDetailComReqDto.setInductionRecordId(querySchemeOpenRecordDetailComRespDto.getOperationInductionId());//SimpleFieldAssign//sourceId:61143_1
            }

            /*D1-3查询个人就职记录信息详情（公共）[715]   */
            Assert.isNull(queryInductionRecordInfoDetailComReqDto.getInductionRecordId(), "B2-3查询方案开通记录详情(管理)-D1-3查询个人就职记录信息详情（公共）-就职记录ID不能为空", false);
            queryInductionRecordInfoDetailComRespDto = fwBaseInductionRecordClient.queryInductionRecordInfoDetailCom(queryInductionRecordInfoDetailComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


            queryInductionRecordInfoDetailComRespDto_1 = queryInductionRecordInfoDetailComRespDto;
        }

        BffQuerySchemeOpenRecordDetailRespDto retData = new BffQuerySchemeOpenRecordDetailRespDto();
        if (querySchemeOpenRecordDetailComRespDto_1 != null) {
            retData.setSchOpenRecordId(querySchemeOpenRecordDetailComRespDto_1.getSchOpenRecordId());//SimpleFieldAssign//sourceId:61150_1
            retData.setApplexId(querySchemeOpenRecordDetailComRespDto_1.getApplexId());//SimpleFieldAssign//sourceId:896471_1
            retData.setApplexRelId(querySchemeOpenRecordDetailComRespDto_1.getApplexRelId());//SimpleFieldAssign//sourceId:896470_1
            retData.setApplObjType(querySchemeOpenRecordDetailComRespDto_1.getApplObjType());//SimpleFieldAssign//sourceId:61158_1
            retData.setApplObjType(querySchemeOpenRecordDetailComRespDto_1.getApplObjType());//SimpleFieldAssign//sourceId:932195_1
            retData.setAuthType(querySchemeOpenRecordDetailComRespDto_1.getAuthType());//SimpleFieldAssign//sourceId:896472_1
            retData.setRemainingQty(querySchemeOpenRecordDetailComRespDto_1.getRemainingQty());//SimpleFieldAssign//sourceId:61167_1
            retData.setAuthUnit(querySchemeOpenRecordDetailComRespDto_1.getAuthUnit());//SimpleFieldAssign//sourceId:896473_1
            retData.setStartTime(querySchemeOpenRecordDetailComRespDto_1.getStartTime());//SimpleFieldAssign//sourceId:61165_1
            retData.setEndTime(querySchemeOpenRecordDetailComRespDto_1.getEndTime());//SimpleFieldAssign//sourceId:61166_1
            retData.setAuthUseType(querySchemeOpenRecordDetailComRespDto_1.getAuthUseType());//SimpleFieldAssign//sourceId:896474_1
            retData.setConfSchemeId(querySchemeOpenRecordDetailComRespDto_1.getConfSchemeId());//SimpleFieldAssign//sourceId:61151_1
            retData.setConfSchemeCode(querySchemeOpenRecordDetailComRespDto_1.getConfSchemeCode());//SimpleFieldAssign//sourceId:104216_1
            retData.setConfSchemeName(querySchemeOpenRecordDetailComRespDto_1.getConfSchemeName());//SimpleFieldAssign//sourceId:61156_1
            retData.setConfSchemeDes(querySchemeOpenRecordDetailComRespDto_1.getConfSchemeDes());//SimpleFieldAssign//sourceId:61168_1
            retData.setConfSchemeTypeCode(querySchemeOpenRecordDetailComRespDto_1.getConfSchemeTypeCode());//SimpleFieldAssign//sourceId:61161_1
            retData.setBizSceneCode(querySchemeOpenRecordDetailComRespDto_1.getBizSceneCode());//SimpleFieldAssign//sourceId:82677_1
            retData.setIsInitialScheme(querySchemeOpenRecordDetailComRespDto_1.getIsInitialScheme());//SimpleFieldAssign//sourceId:61164_1
            retData.setIsCustom(querySchemeOpenRecordDetailComRespDto_1.getIsCustom());//SimpleFieldAssign//sourceId:61162_1
            retData.setIsOpenCustomConf(querySchemeOpenRecordDetailComRespDto_1.getIsOpenCustomConf());//SimpleFieldAssign//sourceId:61163_1
            retData.setIsMainConfScheme(querySchemeOpenRecordDetailComRespDto_1.getIsMainConfScheme());//SimpleFieldAssign//sourceId:82751_1
            retData.setSubjectLifeCycle(querySchemeOpenRecordDetailComRespDto_1.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:61170_1
            retData.setOperationInductionId(querySchemeOpenRecordDetailComRespDto_1.getOperationInductionId());//SimpleFieldAssign//sourceId:61171_1
            retData.setOperateTime(querySchemeOpenRecordDetailComRespDto_1.getOperateTime());//SimpleFieldAssign//sourceId:61172_1
        }
        if (queryInductionRecordInfoDetailComRespDto_1 != null) {
            retData.setUserId(queryInductionRecordInfoDetailComRespDto_1.getUserId());//SimpleFieldAssign//sourceId:61153_1
            retData.setUserFace(queryInductionRecordInfoDetailComRespDto_1.getUserFace());//SimpleFieldAssign//sourceId:61159_1
            retData.setIdCardName(queryInductionRecordInfoDetailComRespDto_1.getIdCardName());//SimpleFieldAssign//sourceId:61155_1
            retData.setNickName(queryInductionRecordInfoDetailComRespDto_1.getNickName());//SimpleFieldAssign//sourceId:61157_1
        }


        return retData;
    }

    /**
     * B2-3删除方案开通记录(平台）[2111]
     * gen by moon at 9/8/2022, 4:07:15 AM
     */
    @Trace(operationName = "B2-3删除方案开通记录(平台）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffDeleteSchemeOpenRecordRespDto deleteSchemeOpenRecord(BffDeleteSchemeOpenRecordReqDto reqDto) {


        //步骤0: D2-3删除方案开通记录 - deleteSchemeOpenRecord
        DeleteSchemeOpenRecordRespDto deleteSchemeOpenRecordRespDto = null;
        DeleteSchemeOpenRecordReqDto deleteSchemeOpenRecordReqDto = new DeleteSchemeOpenRecordReqDto();
        if (reqDto != null) {
            deleteSchemeOpenRecordReqDto.setSchOpenRecordId(reqDto.getSchOpenRecordId());//sourceId:61496_1
        }

        /*D2-3删除方案开通记录[2121]   */
        Assert.isNull(deleteSchemeOpenRecordReqDto.getSchOpenRecordId(), "B2-3删除方案开通记录(平台）-D2-3删除方案开通记录-方案开通记录ID不能为空", false);
        deleteSchemeOpenRecordRespDto = fwCompSchemeOpenRecordClient.deleteSchemeOpenRecord(deleteSchemeOpenRecordReqDto).getData();


        BffDeleteSchemeOpenRecordRespDto retData = new BffDeleteSchemeOpenRecordRespDto();


        return retData;
    }

    /**
     * B2-3查询主题方案开通记录列表(边界)[2137]
     * gen by moon at 9/18/2022, 1:59:06 AM
     */
    @Trace(operationName = "B2-3查询主题方案开通记录列表(边界)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffQueryThemeSchemeOpenRecordListBorderRespDto queryThemeSchemeOpenRecordListBorder(BffQueryThemeSchemeOpenRecordListBorderReqDto reqDto) {


        QueryConfSchemeListRespDto queryConfSchemeListRespDto_1 = null;
//步骤0: D2-3查询配置方案列表 - queryConfSchemeList
        QueryConfSchemeListRespDto queryConfSchemeListRespDto = null;
        QueryConfSchemeListReqDto queryConfSchemeListReqDto = new QueryConfSchemeListReqDto();
        queryConfSchemeListReqDto.setConfSchemeTypeCode("CORE_APP");//sourceId:333472_1
        queryConfSchemeListReqDto.setApplObjType("EVA_THEME");//sourceId:333479_1
        queryConfSchemeListReqDto.setIsInitialScheme("TRUE");//sourceId:333473_1
        queryConfSchemeListReqDto.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:333482_1

        /*D2-3查询配置方案列表[1980]   */
        Assert.isNull(queryConfSchemeListReqDto.getConfSchemeTypeCode(), "B2-3查询主题方案开通记录列表(边界)-D2-3查询配置方案列表-方案类型编码不能为空", false);
        Assert.isNull(queryConfSchemeListReqDto.getApplObjType(), "B2-3查询主题方案开通记录列表(边界)-D2-3查询配置方案列表-应用对象类型不能为空", false);
        Assert.isNull(queryConfSchemeListReqDto.getIsInitialScheme(), "B2-3查询主题方案开通记录列表(边界)-D2-3查询配置方案列表-是否初始方案不能为空", false);
        Assert.isNull(queryConfSchemeListReqDto.getSubjectLifeCycle(), "B2-3查询主题方案开通记录列表(边界)-D2-3查询配置方案列表-生命周期状态不能为空", false);
        queryConfSchemeListRespDto = fwCompConfSchemeClient.queryConfSchemeList(queryConfSchemeListReqDto).getData();


        queryConfSchemeListRespDto_1 = queryConfSchemeListRespDto;

        BffQueryThemeSchemeOpenRecordListBorderRespDto retData = new BffQueryThemeSchemeOpenRecordListBorderRespDto();
        if (queryConfSchemeListRespDto_1 != null) {
            retData.setConfSchemeList(queryConfSchemeListRespDto_1.getConfSchemeList().stream().map(item -> BeanUtil.toBean(item, BffConfSchemeDto.class)).collect(Collectors.toList()));//sourceId:333484_1
        }


        return retData;
    }

    /**
     * B2修改开通记录(管理)[6493]
     * gen by moon at 5/25/2023, 12:27:10 AM
     */
    @Trace(operationName = "B2修改开通记录(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffUpdateSchOpenRecordRespDto updateSchOpenRecord(BffUpdateSchOpenRecordReqDto reqDto) {


        //步骤0: D2修改开通记录(公共) - updateSchOpenRecordCom
        UpdateSchOpenRecordComRespDto updateSchOpenRecordComRespDto = null;
        UpdateSchOpenRecordComReqDto updateSchOpenRecordComReqDto = new UpdateSchOpenRecordComReqDto();
        if (reqDto != null) {
            updateSchOpenRecordComReqDto.setSchOpenRecordId(reqDto.getSchOpenRecordId());//SimpleFieldAssign//sourceId:898394_1
            updateSchOpenRecordComReqDto.setAuthType(reqDto.getAuthType());//SimpleFieldAssign//sourceId:898397_1
            updateSchOpenRecordComReqDto.setRemainingQty(reqDto.getRemainingQty());//SimpleFieldAssign//sourceId:898398_1
            updateSchOpenRecordComReqDto.setAuthUnit(reqDto.getAuthUnit());//SimpleFieldAssign//sourceId:898399_1
            updateSchOpenRecordComReqDto.setStartTime(reqDto.getStartTime());//SimpleFieldAssign//sourceId:898400_1
            updateSchOpenRecordComReqDto.setEndTime(reqDto.getEndTime());//SimpleFieldAssign//sourceId:898401_1
            updateSchOpenRecordComReqDto.setAuthUseType(reqDto.getAuthUseType());//SimpleFieldAssign//sourceId:898402_1
        }

        /*D2修改开通记录(公共)[6484]   */
        Assert.isNull(updateSchOpenRecordComReqDto.getSchOpenRecordId(), "B2修改开通记录(管理)-D2修改开通记录(公共)-开通钥匙ID不能为空", false);
        updateSchOpenRecordComRespDto = fwCompSchemeOpenRecordClient.updateSchOpenRecordCom(updateSchOpenRecordComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffUpdateSchOpenRecordRespDto retData = new BffUpdateSchOpenRecordRespDto();


        return retData;
    }

    /**
     * B2-3查询应用实例配置关系列表(管理)[2102]
     * gen by moon at 5/7/2023, 10:32:54 PM
     */
    @Trace(operationName = "B2-3查询应用实例配置关系列表(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffQueryApplexConrelListBorderRespDto queryApplexConrelListBorder(BffQueryApplexConrelListBorderReqDto reqDto) {


//       QueryApplexConrelListRespDto queryApplexConrelListRespDto_1 =null;
//BatchQuerySpaceComRespDto batchQuerySpaceComRespDto_1 =null;
//BatchQueryOrgListBorderRespDto batchQueryOrgListBorderRespDto_1 =null;
//BatchQueryEvaThemeListRespDto batchQueryEvaThemeListRespDto_1 =null;
//BatchQueryEvaTempRespDto batchQueryEvaTempRespDto_1 =null;
////virtualUsage D2-3查询应用实例配置关系列表  2388
//      QueryApplexConrelListRespDto queryApplexConrelListRespDto = null;
//    QueryApplexConrelListReqDto queryApplexConrelListReqDto=new QueryApplexConrelListReqDto();
//  if(reqDto!=null){
//      queryApplexConrelListReqDto.setConfSchemeId(reqDto.getConfSchemeId());//SimpleFieldAssign//sourceId:896478_1_2388
//queryApplexConrelListReqDto.setAscriptionSpaceId(reqDto.getAscriptionSpaceId());//SimpleFieldAssign//sourceId:62387_1_2388
//    }
//
//    /*D2-3查询应用实例配置关系列表[2143]   */
//    Assert.isNull(queryApplexConrelListReqDto.getConfSchemeId(),"B2-3查询应用实例配置关系列表(管理)-D2-3查询应用实例配置关系列表-配置方案ID 不能为空",false);
//Assert.isNull(queryApplexConrelListReqDto.getAscriptionSpaceId(),"B2-3查询应用实例配置关系列表(管理)-D2-3查询应用实例配置关系列表-归属空间ID不能为空",false);
//      queryApplexConrelListRespDto = fwCompSchemeOpenRecordClient.queryApplexConrelList(queryApplexConrelListReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
//
//
//      queryApplexConrelListRespDto_1 = queryApplexConrelListRespDto;
////virtualUsage D2接收输出参数(公共)  14695
//      QueryOutputParametersDetailComRespDto queryOutputParametersDetailComRespDto = null;
//    QueryOutputParametersDetailComReqDto queryOutputParametersDetailComReqDto=new QueryOutputParametersDetailComReqDto();
//
//
//    /*D2接收输出参数(公共)[4196]   */
//
//      queryOutputParametersDetailComRespDto = fwCompDivineDataClient.queryOutputParametersDetailCom(queryOutputParametersDetailComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
//
//
//
//if((queryApplexConrelListRespDto!= null&&  queryApplexConrelListRespDto.getApplObjType() !=null && queryApplexConrelListRespDto.getApplObjType().equals("TENANT_SPACE"))) {
//        //if(D2-3查询应用实例配置关系列表.应用对象类型 等于 租户空间)  2389
//
//BatchQuerySpaceComRespDto batchQuerySpaceComRespDto = null;
//    if(queryApplexConrelListRespDto !=null){
//          BatchQuerySpaceComReqDto batchQuerySpaceComReqDto=new BatchQuerySpaceComReqDto();
//  if(queryApplexConrelListRespDto!= null&&  queryApplexConrelListRespDto.getApplexConfRelList() !=null&& !CollectionUtil.isEmpty(queryApplexConrelListRespDto.getApplexConfRelList())){
//      batchQuerySpaceComReqDto.setSpaceList(queryApplexConrelListRespDto.getApplexConfRelList().stream().map(item->item.getApplexId())
//        .collect(Collectors.toList()));/*list-to-strings*///sourceId:62460_1_2390
//    }
//
//    /*D1-1批量查询空间(公共)[2149]   */
//
//      batchQuerySpaceComRespDto = fwBaseBaseClient.batchQuerySpaceCom(batchQuerySpaceComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
//      Assert.isTrue(batchQuerySpaceComRespDto== null||  batchQuerySpaceComRespDto.getSpaceList() ==null|| CollectionUtil.isEmpty(batchQuerySpaceComRespDto.getSpaceList())|| batchQuerySpaceComRespDto.getSpaceList().size()==0 ,"找不到数据，系统异常",false);
//
//      batchQuerySpaceComRespDto_1 = batchQuerySpaceComRespDto;
//           }
////processBranchName:正常结束 ,processBranchId:2398
//
//      }
//else if((queryApplexConrelListRespDto!= null&&  queryApplexConrelListRespDto.getApplObjType() !=null && queryApplexConrelListRespDto.getApplObjType().equals("ORG"))){
//       //elseif(D2-3查询应用实例配置关系列表.应用对象类型 等于 组织)  2392
//
//BatchQueryOrgListBorderRespDto batchQueryOrgListBorderRespDto = null;
//    if(queryApplexConrelListRespDto !=null){
//          BatchQueryOrgListBorderReqDto batchQueryOrgListBorderReqDto=new BatchQueryOrgListBorderReqDto();
//  if(queryApplexConrelListRespDto!= null&&  queryApplexConrelListRespDto.getApplexConfRelList() !=null&& !CollectionUtil.isEmpty(queryApplexConrelListRespDto.getApplexConfRelList())){
//      batchQueryOrgListBorderReqDto.setOrgList(queryApplexConrelListRespDto.getApplexConfRelList().stream().map(item->item.getApplexId())
//        .collect(Collectors.toList()));/*list-to-strings*///sourceId:62450_1_2393
//    }
//if(reqDto!=null){
//      batchQueryOrgListBorderReqDto.setSpaceId(reqDto.getAscriptionSpaceId());//SimpleFieldAssign//sourceId:259465_1_2393
//    }
//
//    /*D1-3批量查询组织列表[2148]   */
//    Assert.isNull(batchQueryOrgListBorderReqDto.getSpaceId(),"B2-3查询应用实例配置关系列表(管理)-D1-3批量查询组织列表-创建于空间ID不能为空",false);
//      batchQueryOrgListBorderRespDto = fwCompConfSchemeClient.batchQueryOrgListBorder(batchQueryOrgListBorderReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
//      Assert.isTrue(batchQueryOrgListBorderRespDto== null||  batchQueryOrgListBorderRespDto.getOrgList() ==null|| CollectionUtil.isEmpty(batchQueryOrgListBorderRespDto.getOrgList())|| batchQueryOrgListBorderRespDto.getOrgList().size()==0 ,"找不到数据，系统异常",false);
//
//      batchQueryOrgListBorderRespDto_1 = batchQueryOrgListBorderRespDto;
//           }
////processBranchName:正常结束 ,processBranchId:2399
//
//    }
//else if((queryApplexConrelListRespDto!= null&&  queryApplexConrelListRespDto.getApplObjType() !=null && queryApplexConrelListRespDto.getApplObjType().equals("EVA_THEME"))){
//       //elseif(D2-3查询应用实例配置关系列表.应用对象类型 等于 评价主题)  2394
//
//BatchQueryEvaThemeListRespDto batchQueryEvaThemeListRespDto = null;
//    if(queryApplexConrelListRespDto !=null){
//          BatchQueryEvaThemeListReqDto batchQueryEvaThemeListReqDto=new BatchQueryEvaThemeListReqDto();
//  if(queryApplexConrelListRespDto!= null&&  queryApplexConrelListRespDto.getApplexConfRelList() !=null&& !CollectionUtil.isEmpty(queryApplexConrelListRespDto.getApplexConfRelList())){
//      batchQueryEvaThemeListReqDto.setEvalThemeList(queryApplexConrelListRespDto.getApplexConfRelList().stream().map(item->item.getApplexId())
//        .collect(Collectors.toList()));/*list-to-strings*///sourceId:62423_1_2395
//    }
//if(reqDto!=null){
//      batchQueryEvaThemeListReqDto.setAscriptionSpaceId(reqDto.getAscriptionSpaceId());//SimpleFieldAssign//sourceId:62424_1_2395
//    }
//
//    /*D3-2批量查询评价主题列表[2146]   */
//    Assert.isNull(batchQueryEvaThemeListReqDto.getAscriptionSpaceId(),"B2-3查询应用实例配置关系列表(管理)-D3-2批量查询评价主题列表-归属空间ID不能为空",false);
//      batchQueryEvaThemeListRespDto = fwAppEvaThemeClient.batchQueryEvaThemeList(batchQueryEvaThemeListReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
//
//
//      batchQueryEvaThemeListRespDto_1 = batchQueryEvaThemeListRespDto;
//           }
////processBranchName:正常结束 ,processBranchId:2400
//
//    }
//else if((queryApplexConrelListRespDto!= null&&  queryApplexConrelListRespDto.getApplObjType() !=null && queryApplexConrelListRespDto.getApplObjType().equals("EVA_TEMP"))){
//       //elseif(D2-3查询应用实例配置关系列表.应用对象类型 等于 评价模板)  2396
//
//BatchQueryEvaTempRespDto batchQueryEvaTempRespDto = null;
//    if(queryApplexConrelListRespDto !=null){
//          BatchQueryEvaTempReqDto batchQueryEvaTempReqDto=new BatchQueryEvaTempReqDto();
//  if(queryApplexConrelListRespDto!= null&&  queryApplexConrelListRespDto.getApplexConfRelList() !=null&& !CollectionUtil.isEmpty(queryApplexConrelListRespDto.getApplexConfRelList())){
//      batchQueryEvaTempReqDto.setEvalTempList(queryApplexConrelListRespDto.getApplexConfRelList().stream().map(item->item.getApplexId())
//        .collect(Collectors.toList()));/*list-to-strings*///sourceId:104163_1_5619
//    }
//
//    /*D3-2批量查询评价模板[3074]   */
//
//      batchQueryEvaTempRespDto = fwAppEvaThemeClient.batchQueryEvaTemp(batchQueryEvaTempReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
//
//
//      batchQueryEvaTempRespDto_1 = batchQueryEvaTempRespDto;
//           }
////processBranchName:正常结束 ,processBranchId:2401
//
//    }
//BffQueryApplexConrelListBorderRespDto retData = new BffQueryApplexConrelListBorderRespDto();
//  //数据集融合  MoreListToOneSource
//        if(queryApplexConrelListRespDto_1!= null && !CollectionUtil.isEmpty(queryApplexConrelListRespDto_1.getApplexConfRelList()) ){
//          for (ApplexConfRelDto applexConfRelDto : queryApplexConrelListRespDto_1.getApplexConfRelList()) {
//              BffApplexConfRelDto retElm = new BffApplexConfRelDto();
//             if(queryApplexConrelListRespDto_1!=null){
//      retElm.setApplexRelId(applexConfRelDto.getApplexRelId());//SimpleFieldAssign//sourceId:89888_2
//retElm.setApplObjType(applexConfRelDto.getApplexType());//SimpleFieldAssign//sourceId:89892_2
//retElm.setApplexId(applexConfRelDto.getApplexId());//SimpleFieldAssign//sourceId:89889_2
//    }
//              retData.getApplexConfRelList().add(retElm);
//               if(batchQuerySpaceComRespDto_1!= null){
//          for (FrameworkSpaceDto frameworkSpaceDto : batchQuerySpaceComRespDto_1.getSpaceList()) {
//                if (frameworkSpaceDto.getSpaceId().equals(applexConfRelDto.getApplexId())) {
//                 if(batchQuerySpaceComRespDto_1!=null){
//      retElm.setApplexId(frameworkSpaceDto.getSpaceId());//SimpleFieldAssign//sourceId:89889_2
//retElm.setObjectName(frameworkSpaceDto.getAbbreviation());//SimpleFieldAssign//sourceId:89366_2
//    }
//                }
//            }
//          }
//
// if(batchQueryOrgListBorderRespDto_1!= null){
//          for (OrgDto orgDto : batchQueryOrgListBorderRespDto_1.getOrgList()) {
//                if (orgDto.getOrganizationId().equals(applexConfRelDto.getApplexId())) {
//                 if(batchQueryOrgListBorderRespDto_1!=null){
//      retElm.setApplexId(orgDto.getOrganizationId());//SimpleFieldAssign//sourceId:89889_2
//retElm.setObjectName(orgDto.getOrganizationName());//SimpleFieldAssign//sourceId:89366_2
//    }
//                }
//            }
//          }
//
// if(batchQueryEvaThemeListRespDto_1!= null){
//          for (EvalThemeDto evalThemeDto : batchQueryEvaThemeListRespDto_1.getEvalThemeList()) {
//                if (evalThemeDto.getEvaluationSubjectId().equals(applexConfRelDto.getApplexId())) {
//                 if(batchQueryEvaThemeListRespDto_1!=null){
//      retElm.setApplexId(evalThemeDto.getEvaluationSubjectId());//SimpleFieldAssign//sourceId:89889_2
//retElm.setObjectName(evalThemeDto.getEvaluationSubjectName());//SimpleFieldAssign//sourceId:89366_2
//    }
//                }
//            }
//          }
//
// if(batchQueryEvaTempRespDto_1!= null){
//          for (EvalTempDto evalTempDto : batchQueryEvaTempRespDto_1.getEvalTempList()) {
//                if (evalTempDto.getEvaluationTemplateId().equals(applexConfRelDto.getApplexId())) {
//                 if(batchQueryEvaTempRespDto_1!=null){
//      retElm.setApplexId(evalTempDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:89889_2
//retElm.setObjectName(evalTempDto.getEvaluationTempShortName());//SimpleFieldAssign//sourceId:89366_2
//    }
//                }
//            }
//          }
//
//          }
//        }//sourceId:62462_1


        return null;
    }

    /**
     * B3查询开通对象使用关系列表(管理)[6542]
     * gen by moon at 5/9/2023, 6:45:01 PM
     */
    @Trace(operationName = "B3查询开通对象使用关系列表(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffQueryOpenObjectUsageRelationshipListRespDto queryOpenObjectUsageRelationshipList(BffQueryOpenObjectUsageRelationshipListReqDto reqDto) {


        QueryOpenObjectUsageRelationshipListRespDto queryOpenObjectUsageRelationshipListRespDto_1 = null;
//步骤0: D2查询开通对象使用关系列表 - queryOpenObjectUsageRelationshipList
        QueryOpenObjectUsageRelationshipListRespDto queryOpenObjectUsageRelationshipListRespDto = null;
        QueryOpenObjectUsageRelationshipListReqDto queryOpenObjectUsageRelationshipListReqDto = new QueryOpenObjectUsageRelationshipListReqDto();
        if (reqDto != null) {
            queryOpenObjectUsageRelationshipListReqDto.setConfSchemeId(reqDto.getConfSchemeId());//SimpleFieldAssign//sourceId:913925_1
            queryOpenObjectUsageRelationshipListReqDto.setAscriptionSpaceId(reqDto.getAscriptionSpaceId());//SimpleFieldAssign//sourceId:913926_1
        }

        /*D2查询开通对象使用关系列表[6543]   */
        Assert.isNull(queryOpenObjectUsageRelationshipListReqDto.getConfSchemeId(), "B3查询开通对象使用关系列表(管理)-D2查询开通对象使用关系列表-配置方案ID不能为空", false);
        Assert.isNull(queryOpenObjectUsageRelationshipListReqDto.getAscriptionSpaceId(), "B3查询开通对象使用关系列表(管理)-D2查询开通对象使用关系列表-归属空间ID不能为空", false);
        queryOpenObjectUsageRelationshipListRespDto = fwCompSchemeOpenRecordClient.queryOpenObjectUsageRelationshipList(queryOpenObjectUsageRelationshipListReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        queryOpenObjectUsageRelationshipListRespDto_1 = queryOpenObjectUsageRelationshipListRespDto;

        BffQueryOpenObjectUsageRelationshipListRespDto retData = new BffQueryOpenObjectUsageRelationshipListRespDto();
        if (queryOpenObjectUsageRelationshipListRespDto_1 != null) {
            retData.setOpenObjectUsageRelationshipList(queryOpenObjectUsageRelationshipListRespDto_1.getOpenObjectUsageRelationshipList().stream().map(item -> BeanUtil.toBean(item, BffOpenObjectUsageRelationshipDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:913930_1
        }


        return retData;
    }

    /**
     * B2初设定制答案(管理)[2134]
     * gen by moon at 6/18/2024, 2:29:02 AM
     */
    @Trace(operationName = "B2初设定制答案(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffSetFirstSetCustomResultRespDto setFirstSetCustomResult(BffSetFirstSetCustomResultReqDto reqDto) {


        //步骤0: D2设置定制答案 - setCustomResult
        SetCustomResultRespDto setCustomResultRespDto = null;
        SetCustomResultReqDto setCustomResultReqDto = new SetCustomResultReqDto();
        setCustomResultReqDto.setSetCustomResultTypeCode("SET_CUSTOM_RESULT");//sourceId:1874806_1
        setCustomResultReqDto.setIsUltrResult("TRUE");//sourceId:986285_1
        if (reqDto != null && reqDto.getConfItemResultList() != null && !CollectionUtil.isEmpty(reqDto.getConfItemResultList())) {
            setCustomResultReqDto.setConfItemResultList(reqDto.getConfItemResultList().stream().map(item -> BeanUtil.toBean(item, ConfItemResultDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:1874804_1
        }
        if (reqDto != null) {
            setCustomResultReqDto.setConfItemCategory(reqDto.getConfItemCategory());//SimpleFieldAssign//sourceId:1874829_1
            setCustomResultReqDto.setApplexRelId(reqDto.getApplexRelId());//SimpleFieldAssign//sourceId:489888_1
            setCustomResultReqDto.setClassConfItemId(reqDto.getClassConfItemId());//SimpleFieldAssign//sourceId:489889_1
        }

        /*D2设置定制答案[5407]   */
        Assert.isNull(setCustomResultReqDto.getSetCustomResultTypeCode(), "B2初设定制答案(管理)-D2设置定制答案-设置定制答案类型不能为空", false);
        Assert.isNull(setCustomResultReqDto.getConfItemCategory(), "B2初设定制答案(管理)-D2设置定制答案-选项类型不能为空", false);
        Assert.isNull(setCustomResultReqDto.getApplexRelId(), "B2初设定制答案(管理)-D2设置定制答案-开通对象使用关系ID不能为空", false);
        Assert.isNull(setCustomResultReqDto.getClassConfItemId(), "B2初设定制答案(管理)-D2设置定制答案-配置项关系ID不能为空", false);
        Assert.isNull(setCustomResultReqDto.getIsUltrResult(), "B2初设定制答案(管理)-D2设置定制答案-是否首次答案不能为空", false);
        setCustomResultRespDto = fwCompSchemeOpenRecordClient.setCustomResult(setCustomResultReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffSetFirstSetCustomResultRespDto retData = new BffSetFirstSetCustomResultRespDto();


        return retData;
    }

    /**
     * B2批量升级标准克隆答案(管理)[2141]
     * gen by moon at 6/6/2023, 6:37:42 AM
     */
    @Trace(operationName = "B2批量升级标准克隆答案(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffBatchUpdateUpgradeCriterionCloneResultRespDto batchUpdateUpgradeCriterionCloneResult(BffBatchUpdateUpgradeCriterionCloneResultReqDto reqDto) {


        //步骤0: D2批量升级标准克隆答案 - batchUpdateUpgradeCriterionCloneResult
        BatchUpdateUpgradeCriterionCloneResultRespDto batchUpdateUpgradeCriterionCloneResultRespDto = null;
        BatchUpdateUpgradeCriterionCloneResultReqDto batchUpdateUpgradeCriterionCloneResultReqDto = new BatchUpdateUpgradeCriterionCloneResultReqDto();
        if (reqDto != null) {
            batchUpdateUpgradeCriterionCloneResultReqDto.setApplexRelId(reqDto.getApplexRelId());//SimpleFieldAssign//sourceId:314771_1
        }

        /*D2批量升级标准克隆答案[2142]   */
        Assert.isNull(batchUpdateUpgradeCriterionCloneResultReqDto.getApplexRelId(), "B2批量升级标准克隆答案(管理)-D2批量升级标准克隆答案-使用关系ID不能为空", false);
        batchUpdateUpgradeCriterionCloneResultRespDto = fwCompSchemeOpenRecordClient.batchUpdateUpgradeCriterionCloneResult(batchUpdateUpgradeCriterionCloneResultReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffBatchUpdateUpgradeCriterionCloneResultRespDto retData = new BffBatchUpdateUpgradeCriterionCloneResultRespDto();


        return retData;
    }

    /**
     * B2重设定制答案(管理)[6968]
     * gen by moon at 6/17/2024, 7:31:26 PM
     */
    @Trace(operationName = "B2重设定制答案(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffSetFollowSetCustomResultRespDto setFollowSetCustomResult(BffSetFollowSetCustomResultReqDto reqDto) {


        //步骤0: D2设置定制答案 - setCustomResult
        SetCustomResultRespDto setCustomResultRespDto = null;
        SetCustomResultReqDto setCustomResultReqDto = new SetCustomResultReqDto();
        setCustomResultReqDto.setSetCustomResultTypeCode("UPGRADE_CUSTOM_RESULT");//sourceId:1874801_1
        setCustomResultReqDto.setIsUltrResult("FALSE");//sourceId:986290_1
        if (reqDto != null && reqDto.getConfItemResultList() != null && !CollectionUtil.isEmpty(reqDto.getConfItemResultList())) {
            setCustomResultReqDto.setConfItemResultList(reqDto.getConfItemResultList().stream().map(item -> BeanUtil.toBean(item, ConfItemResultDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:1874802_1
        }
        if (reqDto != null) {
            setCustomResultReqDto.setApplexRelId(reqDto.getApplexRelId());//SimpleFieldAssign//sourceId:986286_1
            setCustomResultReqDto.setClassConfItemId(reqDto.getClassConfItemId());//SimpleFieldAssign//sourceId:986287_1
        }

        /*D2设置定制答案[5407]   */
        Assert.isNull(setCustomResultReqDto.getSetCustomResultTypeCode(), "B2重设定制答案(管理)-D2设置定制答案-设置定制答案类型不能为空", false);
        Assert.isNull(setCustomResultReqDto.getApplexRelId(), "B2重设定制答案(管理)-D2设置定制答案-开通对象使用关系ID不能为空", false);
        Assert.isNull(setCustomResultReqDto.getClassConfItemId(), "B2重设定制答案(管理)-D2设置定制答案-配置项关系ID不能为空", false);
        Assert.isNull(setCustomResultReqDto.getIsUltrResult(), "B2重设定制答案(管理)-D2设置定制答案-是否首次答案不能为空", false);
        setCustomResultRespDto = fwCompSchemeOpenRecordClient.setCustomResult(setCustomResultReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffSetFollowSetCustomResultRespDto retData = new BffSetFollowSetCustomResultRespDto();


        return retData;
    }

    /**
     * B2升级单题标准克隆答案(管理)[6970]
     * gen by moon at 5/27/2023, 5:20:05 PM
     */
    @Trace(operationName = "B2升级单题标准克隆答案(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffImplementUpgradeSingleCriterionCloneResultRespDto implementUpgradeSingleCriterionCloneResult(BffImplementUpgradeSingleCriterionCloneResultReqDto reqDto) {


        //步骤0: D2执行升级单题标准克隆答案 - implementUpgradeSingleCriterionCloneResult
        ImplementUpgradeSingleCriterionCloneResultRespDto implementUpgradeSingleCriterionCloneResultRespDto = null;
        ImplementUpgradeSingleCriterionCloneResultReqDto implementUpgradeSingleCriterionCloneResultReqDto = new ImplementUpgradeSingleCriterionCloneResultReqDto();
        implementUpgradeSingleCriterionCloneResultReqDto.setIsCeResult("FALSE");//sourceId:986598_1
        implementUpgradeSingleCriterionCloneResultReqDto.setIsUltrResult("FALSE");//sourceId:986605_1
        if (reqDto != null) {
            implementUpgradeSingleCriterionCloneResultReqDto.setApplexRelId(reqDto.getApplexRelId());//SimpleFieldAssign//sourceId:986590_1
            implementUpgradeSingleCriterionCloneResultReqDto.setClassConfItemId(reqDto.getClassConfItemId());//SimpleFieldAssign//sourceId:986591_1
        }

        /*D2执行升级单题标准克隆答案[6969]   */
        Assert.isNull(implementUpgradeSingleCriterionCloneResultReqDto.getApplexRelId(), "B2升级单题标准克隆答案(管理)-D2执行升级单题标准克隆答案-使用关系ID不能为空", false);
        Assert.isNull(implementUpgradeSingleCriterionCloneResultReqDto.getClassConfItemId(), "B2升级单题标准克隆答案(管理)-D2执行升级单题标准克隆答案-配置项关系ID不能为空", false);
        Assert.isNull(implementUpgradeSingleCriterionCloneResultReqDto.getIsCeResult(), "B2升级单题标准克隆答案(管理)-D2执行升级单题标准克隆答案-是否定制结果不能为空", false);
        Assert.isNull(implementUpgradeSingleCriterionCloneResultReqDto.getIsUltrResult(), "B2升级单题标准克隆答案(管理)-D2执行升级单题标准克隆答案-是否首次答案不能为空", false);
        implementUpgradeSingleCriterionCloneResultRespDto = fwCompSchemeOpenRecordClient.implementUpgradeSingleCriterionCloneResult(implementUpgradeSingleCriterionCloneResultReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffImplementUpgradeSingleCriterionCloneResultRespDto retData = new BffImplementUpgradeSingleCriterionCloneResultRespDto();


        return retData;
    }

    /**
     * B2恢复标准克隆答案(管理)[6971]
     * gen by moon at 5/27/2023, 5:20:12 PM
     */
    @Trace(operationName = "B2恢复标准克隆答案(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffImplementRecoverCriterionResultRespDto implementRecoverCriterionResult(BffImplementRecoverCriterionResultReqDto reqDto) {


        //步骤0: D2执行升级单题标准克隆答案 - implementUpgradeSingleCriterionCloneResult
        ImplementUpgradeSingleCriterionCloneResultRespDto implementUpgradeSingleCriterionCloneResultRespDto = null;
        ImplementUpgradeSingleCriterionCloneResultReqDto implementUpgradeSingleCriterionCloneResultReqDto = new ImplementUpgradeSingleCriterionCloneResultReqDto();
        implementUpgradeSingleCriterionCloneResultReqDto.setIsUltrResult("TRUE");//sourceId:986606_1
        if (reqDto != null) {
            implementUpgradeSingleCriterionCloneResultReqDto.setApplexRelId(reqDto.getApplexRelId());//SimpleFieldAssign//sourceId:986600_1
            implementUpgradeSingleCriterionCloneResultReqDto.setClassConfItemId(reqDto.getClassConfItemId());//SimpleFieldAssign//sourceId:986601_1
        }

        /*D2恢复单题标准克隆答案[6969]   */
        Assert.isNull(implementUpgradeSingleCriterionCloneResultReqDto.getApplexRelId(), "B2恢复标准克隆答案(管理)-D2恢复单题标准克隆答案-使用关系ID不能为空", false);
        Assert.isNull(implementUpgradeSingleCriterionCloneResultReqDto.getClassConfItemId(), "B2恢复标准克隆答案(管理)-D2恢复单题标准克隆答案-配置项关系ID不能为空", false);
        Assert.isNull(implementUpgradeSingleCriterionCloneResultReqDto.getIsUltrResult(), "B2恢复标准克隆答案(管理)-D2恢复单题标准克隆答案-是否首次答案不能为空", false);
        implementUpgradeSingleCriterionCloneResultRespDto = fwCompSchemeOpenRecordClient.implementUpgradeSingleCriterionCloneResult(implementUpgradeSingleCriterionCloneResultReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffImplementRecoverCriterionResultRespDto retData = new BffImplementRecoverCriterionResultRespDto();


        return retData;
    }
    //
}
